package javase_class_250905;

/**
 * ClassName: StaticTest
 * Package: javase_class_250905
 * Description:
 *
 * @Author harkjeans
 * @Create 2025/9/5 14:17
 * @Version 1.0
 */
public class StaticTest {
    public static void main(String[] args) {
        Chinese c1 = new Chinese("hark", 36);
        c1.nation = "中华人民共和国";

        Chinese c2 = new Chinese("jeans", 66);

        System.out.println(c1);
        System.out.println(c2);

        System.out.println(Chinese.nation);
    }
}
class Chinese{
    //实例变量
    String name;
    int age;
    //类变量
    static String nation;

    public Chinese(){
    }
    public Chinese(String name, int age){
        this.name = name;
        this.age = age;
    }

    @Override
    public String toString(){
        return "Chinese{" + "name='" + name + '\'' +
                ", age=" + age + ", nation='" + nation + '\'' +
                '}';
    }
}